package cn.stylefeng.guns.modular.controller;

import cn.stylefeng.guns.modular.entity.Frameitem;
import cn.stylefeng.guns.modular.service.FrameitemService;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import cn.stylefeng.roses.core.reqres.response.SuccessResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Collection;

/**
 * @author third_e
 * @create 2019/12/12 0012-上午 12:08
 */
@Controller
@RequestMapping("/frameitem")
public class FrameitemController extends BaseController {

    @Autowired
    public FrameitemService frameitemService;
    /**
     * 获取框架项内容
     */
    @RequestMapping("/getOneFrameitemInfo")
    @ResponseBody
    public ResponseData frameitemInfo(@RequestParam("frameId") Long frameId){

        Collection<Frameitem> frameitems = this.frameitemService.selectFramitem(frameId);
        return ResponseData.success(frameitems);
    }
}
